﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ORM;


namespace project_phoebus.CruiseCompany
{
    class Program
    {


        static void Main(string[] args)
        {
#if true
            using (MainModelContainer context = new MainModelContainer())
            {
                CostShip CostMagnifica = new CostShip
                {
                    Charge = 2500.00,
                    Profit = 1000.00,
                    Payment = 1500.00

                };
                CostShip CostAIDAsol = new CostShip
                {
                    Charge = 3000.00,
                    Profit = 1800.00,
                    Payment = 1200.00

                };
                CostShip CostAIDAblu = new CostShip
                {
                    Charge = 3500.00,
                    Profit = 1800.00,
                    Payment = 1700.00

                };
                CostShip CostAzura = new CostShip
                {
                    Charge = 5000.00,
                    Profit = 2000.00,
                    Payment = 3000.00

                };
                CostShip CostCarnivalDream = new CostShip
                {
                    Charge = 5200.00,
                    Profit = 2100.00,
                    Payment = 3100.00

                };
                Ship Magnifica = new Ship
                {
                    Name = "Magnifica",
                    Speed = 45,
                    Survey = new DateTime (2010, 07, 10),
                    Launch = new DateTime(2001, 04, 25),
                    Model = "Musica",
                    Autonomy = 20.00
                };
                Ship AIDAsol = new Ship
                {
                    Name = "AIDAsol",
                    Speed = 40,
                    Survey = new DateTime (2009, 05, 20),
                    Launch = new DateTime(2003, 04, 05),
                    Model = "Sphinks",
                    Autonomy = 15.00
                };

                Ship AIDAblu = new Ship
                {
                    Name = "AIDAblu",
                    Speed = 42,
                    Survey = new DateTime(2010, 04, 17),
                    Launch = new DateTime (2002, 07, 03),
                    Model = "Sphinks",
                    Autonomy = 15.00
                };

                Ship Azura = new Ship
                {
                    Name = "Azura",
                    Speed = 40,
                    Survey = new DateTime(2009, 03, 15),
                    Launch = new DateTime(2001, 10, 27),
                    Model = "Oasis",
                    Autonomy = 25.00
                };

                Ship CarnivalDream = new Ship
                {
                    Name = "CarnivalDream",
                    Speed = 35,
                    Survey = new DateTime(2008, 08, 10),
                    Launch = new DateTime(2000, 11, 15),
                    Model = "Dream",
                    Autonomy = 20.00
                };

                Cabins CabinsMagnifica = new Cabins
                {
                    Level = "First",
                    ShipId = 2,
                    Total = 1500,
                    Margin = 25.00,
                    Description = "Cabins of first level"
                };

                Cabins CabinsAIDAsol = new Cabins
                {
                    Level = "Second",
                    ShipId = 1,
                    Total = 1700,
                    Margin = 30.00,
                    Description = "Cabins of second level"
                };

                Cabins CabinsAIDAblu = new Cabins
                {
                    Level = "First",
                    ShipId = 5,
                    Total = 1800,
                    Margin = 45.00,
                    Description = "Cabins of first level"
                };

                Cabins CabinsAzura = new Cabins
                {
                    Level = "Third",
                    ShipId = 4,
                    Total = 2000,
                    Margin = 40.00,
                    Description = "Cabins of third level"
                };

                Cabins CabinsCarnivalDream = new Cabins
                {
                    Level = "Second",
                    ShipId = 3,
                    Total = 2200,
                    Margin = 30.00,
                    Description = "Cabins of second level"
                };

                Course Kiev_Dnepropetrovsk = new Course
                {
                    Title = "Kiev_Dnepropetrovsk",
                    Description = "Good Course",
                    Duration = 5
                };

                Course Kiev_Herson = new Course
                {
                    Title = "Kiev_Herson",
                    Description = "Good/not good Course",
                    Duration = 8
                };

                Course Kiev_Odessa = new Course
                {
                    Title = "Kiev_Odessa",
                    Description = "Good/not good Course",
                    Duration = 10
                };

                Course Kiev_Yalta = new Course
                {
                    Title = "Kiev_Yalta",
                    Description = "Good good Course",
                    Duration = 11
                };

                Course Kiev_Sevastopol = new Course
                {
                    Title = "Kiev_Sevastopol",
                    Description = "Good good Course",
                    Duration = 15
                };

                Tour tour_Dnepropetrovsk = new Tour
                {
                    Date_begin = new DateTime (2012, 08, 01),
                    Date_end = new DateTime (2012, 08, 06)
                };

                Tour tour_Herson = new Tour
                {
                    Date_begin = new DateTime(2012, 08, 04),
                    Date_end = new DateTime(2012, 08, 13)
                };

                Tour tour_Odessa = new Tour
                {
                    Date_begin = new DateTime(2012, 08, 10),
                    Date_end = new DateTime(2012, 08, 21)
                };

                Tour tour_Yalta = new Tour
                {
                    Date_begin = new DateTime(2012, 08, 15),
                    Date_end = new DateTime(2012, 08, 27)
                };

                Tour tour_Sevastopol = new Tour
                {
                    Date_begin = new DateTime(2012, 08, 15),
                    Date_end = new DateTime(2012, 08, 31)
                };

                CoursePoint id1 = new CoursePoint
                {
                    CourseRId = 1,
                    CheckPointRId = 1
                };

                CoursePoint id2 = new CoursePoint
                {
                    CourseRId = 2,
                    CheckPointRId = 2
                };

                CoursePoint id3 = new CoursePoint
                {
                    CourseRId = 3,
                    CheckPointRId = 3
                };

                CoursePoint id4 = new CoursePoint
                {
                    CourseRId = 4,
                    CheckPointRId = 4
                };

                CoursePoint id5 = new CoursePoint
                {
                    CourseRId = 5,
                    CheckPointRId = 5
                };

                CheckPoint Point_Dnepropetrovsk = new CheckPoint
                {
                    Title = "Dnepropetrovsk",
                    Longtitude = "+48 29",
                    Latitude = "- 35  0",
                    Description = "Good City"
                };

                CheckPoint Point_Herson = new CheckPoint
                {
                    Title = "Herson",
                    Longtitude = "46 39",
                    Latitude = "32 38",
                    Description = "Good City"
                };

                CheckPoint Point_Odessa = new CheckPoint
                {
                    Title = "Odessa",
                    Longtitude = "46 30",
                    Latitude = "30 46",
                    Description = "Good City"
                };

                CheckPoint Point_Yalta = new CheckPoint
                {
                    Title = "Yalta",
                    Longtitude = "44 30",
                    Latitude = "34  9",
                    Description = "Good City"
                };

                CheckPoint Point_Sevastopol = new CheckPoint
                {
                    Title = "Sevastopol",
                    Longtitude = "44 36",
                    Latitude = "33 31",
                    Description = "Good City"
                };

                Excursion Dnepropetrovsk = new Excursion 
                {
                    TStart = new DateTime (2012, 08, 03),
                    Subject = "City sights",
                    Description = "Not bad excursion",
                    FreeOfCharge = true,
                    Price = 0
                };

                Excursion Herson = new Excursion
                {
                    TStart = new DateTime(2012, 08, 05),
                    Subject = "City sights",
                    Description = "Not bad excursion",
                    FreeOfCharge = false,
                    Price = 100
                };

                Excursion Odessa = new Excursion
                {
                    TStart = new DateTime(2012, 08, 11),
                    Subject = "City sights",
                    Description = "Not bad excursion",
                    FreeOfCharge = false,
                    Price = 200
                };

                Excursion Yalta = new Excursion
                {
                    TStart = new DateTime(2012, 08, 13),
                    Subject = "City sights",
                    Description = "Not bad excursion",
                    FreeOfCharge = true,
                    Price = 0
                };

                Excursion Sevastopol = new Excursion
                {
                    TStart = new DateTime(2012, 08, 25),
                    Subject = "City sights",
                    Description = "GOOD excursion",
                    FreeOfCharge = true,
                    Price = 0
                };
            }

#elif false
            
                for (int i = 1; i < 5; i++)
                {
                    //string tmp = "user" + i.ToString();
                    //string salt = Engine.GenerateSalt();
                    //string pass = Engine.Crypted(tmp, salt);
                    Tour TourInfo = new Tour
                    {
                        //Login = "User" + i.ToString(),
                        //Salt = salt,
                        //Password = pass,
                        //Role = "User",
                        //FName = "FName",
                        //SName = "SName",
                        //BDate = new DateTime(1989 + i, i, i),
                        //Email = "mail@server.com",
                        //Phone = "555-555"

                        Date_begin = new DateTime(1989 + i, i, i),
                        Date_end = new DateTime(1989 + i, i+5, i),
                    
                        
                    };

                    ClientEF.Create(TourInfo);
                
            }

#elif true
            //UserDataService.DropUsers();

            //User UserInfo = new User();
            //UserInfo = UserDataService.GetUserId(1);
            //UserInfo.Login = "NEW+LOGIN";
            //UserEF.Update(UserInfo);

            //UserInfo = UserDataService.GetUserLogin("NEW+LOGIN");
            //if (UserInfo != null)
            //    Console.WriteLine(UserInfo.Login);
            //UserInfo = UserDataService.GetUserId(1);
            //if (UserInfo != null) 
            //    Console.WriteLine(UserInfo.Login);

            //foreach (User UserInfo in UserDataService.GetAllUsers())
            IClientDataService DS = Fabrica.CreateClientDataService();

            
            

#endif
            Console.Read();
        }
    }
}
